# -*- coding: utf-8 -*- 
#
# Description:
#
#  Definiton
#
#
#
# Changes:
#
# 2012-01-10
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 (polo35580@hotmail.fr)
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

nname: 0
n 0(None)[Container.__init__(self)
self.repository = None
self.folder_icon = None
self.plus_icon = None
self._max_depth = max_depth
self._depth = 0
return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb770e76c>}
nname: 0
n 0(None)[self.set_depth(value)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb770e30c>}
nname: 0
n 0(None)[self._depth = depth
self._redraw()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb770e38c>}
nname: 0
n 0(None)[self._max_depth = max_depth
self._redraw()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb770e2ac>}
nname: 0
n 0(None)[self.repository = repository
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb770e2cc>}
nname: 0
n 0(None)[self.folder_icon = folder_icon
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb770e5cc>}
nname: 0
n 0(None)[self.plus_icon = plus_icon
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb770e2ac>}
nname: 230
n 230(None)[]:
	i: 122(AL), 229()
	o: 

nname: 229
n 229(None)[]:
	i: 125(AF), 153()
	o: 230()

nname: 153
n 153(None)[for i in xrange(min(self._depth, self._max_depth)):
icon = Image(image_or_file=self.folder_icon, repository=self.repository)
left = '%i%%' % relative_width * (i + 1)
self.add_child(icon, width=width, left=left)
]:
	i: 125(for)
	o: 229()

nname: 125
n 125(None)[]:
	i: 122(loop)
	o: 153(for), 229(AF)

nname: 122
n 122(None)[]:
	i: 65(), 121()
	o: 125(loop), 230(AL)

nname: 121
n 121(None)[]:
	i: 0(f)
	o: 122()

nname: 65
n 65(None)[plus_icon = Image(image_or_file=self.plus_icon, repository=self.repository)
self.add_child(plus_icon, width=width, left='0%')
]:
	i: 0(t)
	o: 122()

nname: 0
n 0(self._depth > self._max_depth)[relative_width = round(1.0 / (self._max_depth + 1) * 100.0)
width = '%i%%' % relative_width
self.wipe()
]:
	i: 
	o: 65(t), 121(f)

nname: 229
n 229(None)[]:
	i: 125()
	o: 

nname: 125
n 125(None)[for i in xrange(min(self._depth, self._max_depth)):
	icon = Image(image_or_file=self.folder_icon, repository=self.repository)
	left = '%i%%' % relative_width * (i + 1)
	self.add_child(icon, width=width, left=left)
]:
	i: 0(loop)
	o: 229()

nname: 0
n 0(None)[relative_width = round(1.0 / (self._max_depth + 1) * 100.0)
width = '%i%%' % relative_width
self.wipe()
if self._depth > self._max_depth:
	plus_icon = Image(image_or_file=self.plus_icon, repository=self.repository)
	self.add_child(plus_icon, width=width, left='0%')
]:
	i: 
	o: 125(loop)

nname: 229
n 229(None)[]:
	i: 0()
	o: 

nname: 0
n 0(None)[relative_width = round(1.0 / (self._max_depth + 1) * 100.0)
width = '%i%%' % relative_width
self.wipe()
if self._depth > self._max_depth:
	plus_icon = Image(image_or_file=self.plus_icon, repository=self.repository)
	self.add_child(plus_icon, width=width, left='0%')
for i in xrange(min(self._depth, self._max_depth)):
	icon = Image(image_or_file=self.folder_icon, repository=self.repository)
	left = '%i%%' % relative_width * (i + 1)
	self.add_child(icon, width=width, left=left)
]:
	i: 
	o: 229()

nname: 0
n 0(None)[relative_width = round(1.0 / (self._max_depth + 1) * 100.0)
width = '%i%%' % relative_width
self.wipe()
if self._depth > self._max_depth:
	plus_icon = Image(image_or_file=self.plus_icon, repository=self.repository)
	self.add_child(plus_icon, width=width, left='0%')
for i in xrange(min(self._depth, self._max_depth)):
	icon = Image(image_or_file=self.folder_icon, repository=self.repository)
	left = '%i%%' % relative_width * (i + 1)
	self.add_child(icon, width=width, left=left)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb770ef0c>}
nname: 6
n 6(None)[__doc__ = 'Bar that reflects the current depth of a filesystem browser.'
def __init__(self, max_depth=10):
	Container.__init__(self)
	self.repository = None
	self.folder_icon = None
	self.plus_icon = None
	self._max_depth = max_depth
	self._depth = 0
	return None

def update(self, signal, sender, value):
	self.set_depth(value)

initialize = update
def set_depth(self, depth):
	self._depth = depth
	self._redraw()

def set_max_depth(self, max_depth):
	self._max_depth = max_depth
	self._redraw()

def set_repository(self, repository):
	self.repository = repository

def set_folder_icon(self, folder_icon):
	self.folder_icon = folder_icon

def set_plus_icon(self, plus_icon):
	self.plus_icon = plus_icon

def _redraw(self):
	relative_width = round(1.0 / (self._max_depth + 1) * 100.0)
	width = '%i%%' % relative_width
	self.wipe()
	if self._depth > self._max_depth:
		plus_icon = Image(image_or_file=self.plus_icon, repository=self.repository)
		self.add_child(plus_icon, width=width, left='0%')
	for i in xrange(min(self._depth, self._max_depth)):
		icon = Image(image_or_file=self.folder_icon, repository=self.repository)
		left = '%i%%' % relative_width * (i + 1)
		self.add_child(icon, width=width, left=left)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb7706f2c>}
nname: 0
n 0(None)[from __future__ import absolute_import
from wyvas import Container, Image
class DepthBar(Container):
	__doc__ = 'Bar that reflects the current depth of a filesystem browser.'
	def __init__(self, max_depth=10):
		Container.__init__(self)
		self.repository = None
		self.folder_icon = None
		self.plus_icon = None
		self._max_depth = max_depth
		self._depth = 0
		return None

	def update(self, signal, sender, value):
		self.set_depth(value)

	initialize = update
	def set_depth(self, depth):
		self._depth = depth
		self._redraw()

	def set_max_depth(self, max_depth):
		self._max_depth = max_depth
		self._redraw()

	def set_repository(self, repository):
		self.repository = repository

	def set_folder_icon(self, folder_icon):
		self.folder_icon = folder_icon

	def set_plus_icon(self, plus_icon):
		self.plus_icon = plus_icon

	def _redraw(self):
		relative_width = round(1.0 / (self._max_depth + 1) * 100.0)
		width = '%i%%' % relative_width
		self.wipe()
		if self._depth > self._max_depth:
			plus_icon = Image(image_or_file=self.plus_icon, repository=self.repository)
			self.add_child(plus_icon, width=width, left='0%')
		for i in xrange(min(self._depth, self._max_depth)):
			icon = Image(image_or_file=self.folder_icon, repository=self.repository)
			left = '%i%%' % relative_width * (i + 1)
			self.add_child(icon, width=width, left=left)



]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb770632c>}
from __future__ import absolute_import
from wyvas import Container, Image
class DepthBar(Container):
	__doc__ = 'Bar that reflects the current depth of a filesystem browser.'
	def __init__(self, max_depth=10):
		Container.__init__(self)
		self.repository = None
		self.folder_icon = None
		self.plus_icon = None
		self._max_depth = max_depth
		self._depth = 0
		return None

	def update(self, signal, sender, value):
		self.set_depth(value)

	initialize = update
	def set_depth(self, depth):
		self._depth = depth
		self._redraw()

	def set_max_depth(self, max_depth):
		self._max_depth = max_depth
		self._redraw()

	def set_repository(self, repository):
		self.repository = repository

	def set_folder_icon(self, folder_icon):
		self.folder_icon = folder_icon

	def set_plus_icon(self, plus_icon):
		self.plus_icon = plus_icon

	def _redraw(self):
		relative_width = round(1.0 / (self._max_depth + 1) * 100.0)
		width = '%i%%' % relative_width
		self.wipe()
		if self._depth > self._max_depth:
			plus_icon = Image(image_or_file=self.plus_icon, repository=self.repository)
			self.add_child(plus_icon, width=width, left='0%')
		for i in xrange(min(self._depth, self._max_depth)):
			icon = Image(image_or_file=self.folder_icon, repository=self.repository)
			left = '%i%%' % relative_width * (i + 1)
			self.add_child(icon, width=width, left=left)



